package com.xhwl.data.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xhwl.common.pojo.ResultJson;
import com.xhwl.data.pojo.PermissionAuth;
import com.xhwl.data.pojo.PermissionAuthDTO;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: luyi
 * @Description:
 * @Date: Create in 10:13 2023/2/14
 */
@RestController
public interface IPermissionAuthService extends IService<PermissionAuth> {


    ResultJson create(PermissionAuthDTO permissionAuthDTO);

    ResultJson update(PermissionAuthDTO permissionAuthDTO);

    ResultJson delete(Integer id);

    ResultJson delete(List<Integer> id);

    /**
     * 保存这些授权信息
     * @param permissionAuths
     */
    void updateEveryServer(List<PermissionAuth> permissionAuths,Integer appId);

    @RequestMapping(value = "/permission-auth-service/refresh-app-auth", method = RequestMethod.POST)
    void refreshAppAuth(@RequestPart(required = false) String appId);
}
